package shujia.day05;

class Student {
    private String name = "张三";
    private int age = 18;

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

public class StudentDemo1 {
    public static void main(String[] args) {
        //创建一个学生对象
        Student s1 = new Student("张成阳", 14);
        s1.setName("方直");
        s1.setAge(16);
        System.out.println("姓名：" + s1.getName() + ", 年龄：" + s1.getAge());
    }
}
